package com.cskaoyan.day31.work1._04_proxy._02_dynamic_proxy._01_jdk_dynamic_proxy;

import net.sf.cglib.proxy.InvocationHandler;

import java.lang.reflect.Method;
import java.util.Arrays;

public class InvocationHandlerCola implements InvocationHandler {

    Object instance;
    public InvocationHandlerCola(Object instance){
        this.instance = instance;
    }

    @Override
    public Object invoke(Object o, Method method, Object[] objects) throws Throwable {
        System.out.println("当前调用的方法为："+method);
        System.out.println("当前调用方法的参数为：" + Arrays.asList(objects));
        Object result = method.invoke(instance, objects);
        return result;
    }
}
